home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / MISC / TIMEDATE.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-15  |  1KB  |  33 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; time and date handling
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBBAS;
  10.  
  11.  
  12. var Time1, Time2 : TimeObjectType;
  13.  
  14. begin
  15.      Time1.Initialize;
  16.  
  17.      WriteLn ('* Date handling *');
  18.  
  19.      WriteLn ('Today is ', Profile.Environment.DayNames[Time1.DayOfWeek]);
  20.      if Time1.IsLeapYear then WriteLn ('It''s a leap year.');
  21.  
  22.      Time2.InitializeDuplicate (@Time1);
  23.  
  24.      if Time1.IsEqual(@Time2) then WriteLn ('Duplicated time into a new object.');
  25.      WriteLn ('It''s the ', Time1.DayOfYear, ' day of this year.');
  26.  
  27.      WriteLn ('Now is ', Time2.StringDate,
  28.               ' at ', Time1.StringTime, ' o''clock.');
  29.  
  30.      WriteLn (Time2.StringMidnightTime, ' has passed since midnight.');
  31.  
  32.      Time1.Intercept; Time2.Intercept;
  33. end.